package com.haiheng.module_main.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.haiheng.library_base.adapter.BaseAdapter
import com.haiheng.module_main.bean.HomeIconBean
import com.haiheng.module_main.databinding.ItemBookListBinding
import com.haiheng.module_main.databinding.ItemHomeListBinding

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/8/9 0009
 * @Version: 1.0
 */
class HomeListAdapter : BaseAdapter<HomeIconBean>() {
     override fun onCreateViewBinding(viewType: Int): (LayoutInflater, ViewGroup, Boolean) -> ViewBinding {
        return ItemHomeListBinding::inflate
    }

    override fun onItemView(holder: ViewBindHolder, position: Int, item: HomeIconBean) {
        val binding = holder.binding as ItemHomeListBinding
        binding.tvName.setText(item.name)
        binding.ivIcon.setImageResource(item.resId)
    }

}